function [welfareSize] = WelfareSearcher(crosscurrencybasis,alphaval,crossmarketval)
%Returns welfare in millions based on a given ccb, alpha value, and
%crossmarket value
TickSizes = [0.00005 0.0001 0.00005 0.00005 0.0000005];
ContractSizes = [75000 81250 75000 150000 120000];
counter = 4;

foreignrate = (1/(1+crosscurrencybasis)) -1;
robust = 1/crossmarketval;

%For a given cross-currency basis, price impact parameter, and cross-market
%spillover assumption between forwards and spot market, comput the 
Values = @(m) [(1+sign(m)*(TickSizes(1,counter)*alphaval/robust).*(abs(m)*1000000/(ContractSizes(1,counter))).^0.5)./(1-sign(m)*(TickSizes(1,counter)*alphaval/robust).*(abs(m)*1000000/ContractSizes(1,counter)).^0.5) .* (1./(1+foreignrate)).^0.25 - 1]';
options = optimoptions('fsolve','FunctionTolerance',1e-12,'OptimalityTolerance',1e-24,'StepTolerance',1e-12,'MaxFunctionEvaluations',1e3);
        
m1 = fsolve(Values,1,options);
grid = (1:max(1,round(m1/1000,0)):abs(m1))*sign(m1);
evals = Values(grid);
welfareSize = sum(evals)*max(1,round(m1/1000,0));

end

